home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: Date
- Date: Thu, 18 Apr 96 20:50:01 GMT
- Organization: none
- Message-ID: <829860601snz@genesis.demon.co.uk>
- References: <317322F1.1350@is.nyu.edu>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <317322F1.1350@is.nyu.edu>
- cqr2051@is.nyu.edu "Collin Rodolitz" writes:
-
- >How do you get the date in C on a UNIX machine?
-
- See the standard C functions in time.h. You can get a value that represents
- the current date and time using the time() function. You can break it
- out into a structure of component values (seconds, hour of day, day of month
- etc.) using localtime() or gmtime(). You can generate or print out formatted
- time string using asctime(), ctime() and strftime(). You can calculate the
- difference between two time values in seconds using difftime().
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-